﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ExBlogger.Tests.Unity;
using Microsoft.Practices.ServiceLocation;
using Microsoft.Practices.Unity;
using Microsoft.Practices.Unity.Configuration;

namespace ExBlogger.Tests
{
    class ServiceLocatorHelper
    {
        public static void Init() {
            InitializeServiceLocator();
        }

        private static void InitializeServiceLocator()
        {
            IUnityContainer container = new UnityContainer();
            ComponentRegistrar.AddComponentsTo(container);
            container.LoadConfiguration();
            ServiceLocator.SetLocatorProvider(() => new UnityServiceLocator(container));
        }
    }
}
